/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ControlEscolar.Validations;

import com.ControlEscolar.Beans.Major;
import com.ControlEscolar.DAOs.CurriculumDAO;
import com.ControlEscolar.DAOs.DAOException;
import com.ControlEscolar.DAOs.MajorDAO;
import java.util.ArrayList;

/**
 *
 * @author Rodna Marrufo
 */
public class ValidationsMajor extends BasicValidation{
    MajorDAO majorDAO=new MajorDAO();
    CurriculumDAO curriculumDAO=new CurriculumDAO();

    public boolean isExistMajor(String ID_Major) throws DAOException{
        Major searchMajor= majorDAO.queryByID(ID_Major);
        return isFound(searchMajor);
         
    }

    public boolean isMajorInCurriculum(String ID_Major) throws DAOException{
        ArrayList searchMajorInCurriculum=curriculumDAO.queryByID_Major(ID_Major);
        return isFound(searchMajorInCurriculum);
    }

}
